package com.blog4j.requestRate.configure;

import com.blog4j.requestRate.aop.RequestRateAspect;
import com.blog4j.requestRate.properties.RequestRateProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 98k灬
 * @version v1.0.0
 * @Description : 功能描述
 * @Create on : 2024/9/1 11:46
 **/
@Configuration
@EnableConfigurationProperties(value = { RequestRateProperties.class })
@ConditionalOnProperty(value = "requestRate.enabled", havingValue = "true")
public class RequestRateConfigure {
    @Bean
    public RequestRateAspect requestRateAspect() {
        return new RequestRateAspect();
    }
}
